package br.com.gtoolz.myimc;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import br.com.gtoolz.myimc.R;
import br.com.gtoolz.myimc.extras.Teclado;
import br.com.gtoolz.myimc.work.ImcWork;

public class CalculoDoImcActivity extends Activity {

	ImcWork imc;
	private Button botaoEnviar;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_calculo_imc);

		this.imc = new ImcWork(this);
		this.botaoEnviar = (Button) findViewById(R.id.btn_enviar);
		
	}

	@Override
	protected void onResume() {
		super.onResume();
		
		botaoEnviar.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View view) {
				imc.calculaIMC();
				imc.implementaBotaoSalvar();
				new Teclado(CalculoDoImcActivity.this).esconder();
			}
		});
		
	}

}
